package ooday02;

/**
 * 教师：派生类
 * @author ${pxl}
 */
public class Teacher extends Person{
    double salary;
    void teach(){
        System.out.println(name+"正在上课...");
    }
    Teacher(String name, String address,int age,double salary){
        //把name,address,age传给超类，传递的是值
        super(name, address, age);
        this.salary=salary;
    }
    @Override
    void sayHi(){
        System.out.println("大家好，我叫"+name+"，今年"+age+"岁了，家住"+address+"月薪"+salary);
    }
}
